import com.jreg.RegistryException;
import com.jreg.RegistryKey;

public class Main {

	public static void main(String[] args) throws RegistryException {
		RegistryKey key = new RegistryKey(
				"HKEY_CURRENT_USER\\Software\\JavaSoft\\Prefs\\com");
		RegistryKey key0 = new RegistryKey(
				"HKEY_CURRENT_USER\\Software\\JavaSoft\\Prefs\\com0");
		if (key0.exists())
			key0.delete();
		
		System.out.println(key.queryValues());
		System.out.println(key.querySubkeys(true));
		// System.out.println("key exists? " + key.exists());

//		String jar = "C:\\Users\\TaG\\workspace\\Touchpad Desktop\\Touchpad.jar";
//		String keyName = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run";
//		RegistryKey key = new RegistryKey(keyName);
//		RegistryValue regValue = new RegistryValue(key, "Touchpad");
//		if (true) {
//			String home = System.getProperty("java.home");
//			String value = "javaw.exe -jar '" + jar + "'";
//			regValue.setValue(Type.REG_SZ, value);
//			regValue.add();
//		} else if (regValue.exists()) {
//			regValue.delete();
//		}
	}

}